package com.ecp.commons;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Global {

	public static final int								ALL									= -1;
	public static final int								NotSet								= -1;

	public static final int								YES									= 1;
	public static final int								NO									= 0;

	public static final String							KEY_FRONTEND_USERNAME				= "FrontUser";								// 前台用户用这个Key保存
	public static final String							KEY_OA_ADMIN						= "OA_Admin";

	public static final String							KEY_BACKEN_BUYERID					= "buyer";
	public static final String							KEY_GENERAL_BUYER					= "BuyerUser";								// 前后台用户通用的购买者字段
	public static final String							KEY_BACKEND_BUYER					= "buyer";									// 后台管理员给用户下单的时候，用于保存用户的session

	public static final String							KEY_BACKEND_USER					= "backend-user";
	public static final String							KEY_BACKEND_USERNAME				= "backend-username";
	public static final String							KEY_BACKEND_MERCHANT				= "backend_merchant";
	public static final String							KEY_PARTNER_ID						= "session_partner_id";
	public static final String							KEY_SESSION_PARTNER					= "session_partner_id";
	public static final String							KEY_BACKEND_SHOW_COLUMN				= "backend_show_column";
	public static final String							KEY_BACKEND_PRIVILEGE_COLUMN		= "backend_privilege_column";
	public static final String							KEY_BACKEND_PRIVILEGE_ACTION		= "backend_privilege_action";

	public static final String							KEY_SESSION_LOGIN_TYPE				= "session_login_type";

	public static final String							URL_BACKEND_LOGIN					= "/admin/login.jsp";

	public static String								KEY_EXTRA_PARAM						= "extraparam";
	public static final int								NORMAL_STORAGE						= 52620;
	public static final int								WAREHOSE_ROOT						= 41002;

	public static final int								MERCHANDISE_PIC_TYPE_SUM			= 5;
	public static final int								MERCHANDISE_PIC_TYPE_MINI			= 1;
	public static final int								MERCHANDISE_PIC_TYPE_SMALL			= 2;
	public static final int								MERCHANDISE_PIC_TYPE_MIDDLE			= 3;
	public static final int								MERCHANDISE_PIC_TYPE_BIG			= 4;
	public static final int								MERCHANDISE_PIC_TYPE_LARGE			= 5;

	public static final int								MERCHANDISE_PIC_GROUP_SUM			= 5;
	public static final int								MERCHANDISE_PIC_GROUP_FIRST			= 1;
	public static final int								MERCHANDISE_PIC_GROUP_SECOND		= 2;
	public static final int								MERCHANDISE_PIC_GROUP_THIRD			= 3;
	public static final int								MERCHANDISE_PIC_GROUP_FOURTH		= 4;
	public static final int								MERCHANDISE_PIC_GROUP_FIFTH			= 5;

	public static final int								OBJ_TYPE_COLUMN						= 0;
	public static final int								OBJ_TYPE_ARTICLE					= 1;
	public static final int								OBJ_TYPE_USER						= 10002;
	public static final int								OBJ_TYPE_BUSINESSRULE				= 10003;
	public static final int								OBJ_TYPE_MERCHANDISE				= 10004;
	public static final int								OBJ_TYPE_ORDER						= 10005;
	public static final int								OBJ_TYPE_ORDERITEM					= 10006;
	public static final int								OBJ_TYPE_MERCHANT					= 10007;
	public static final int								OBJ_TYPE_PLAYER						= 10010;
	public static final int								OBJ_TYPE_LEDGER						= 10020;
	public static final int								OBJ_TYPE_LEDGER_DOC_DETAIL			= 10021;
	public static final int								OBJ_TYPE_LEDGER_DOC					= 10022;
	public static final int								OBJ_TYPE_PRICEVALUE					= 10030;
	public static final int								OBJ_TYPE_PRICEVALUE_EXTENSION		= 10031;
	public static final int								OBJ_TYPE_PARTNER					= 10040;
	public static final int								OBJ_TYPE_EXTENSION_VALUE			= 10050;
	public static final int								OBJ_TYPE_DELIVERY_RULE				= 10050;
	public static final int								OBJ_TYPE_CHART_OF_ACCOUNTS			= 10060;
	public static final int								OBJ_TYPE_USER_GRADE_RULE_TYPE		= 10070;
	public static final int								OBJ_TYPE_EXTENAL_PRICE_ENTITY_TYPE	= 10080;
	public static final int								OBJ_TYPE_PRICETYPE					= 10081;
	public static final int								OBJ_TYPE_USER_CATEGORY_TYPE			= 10090;
	public static final int								OBJ_TYPE_ERPPRODUCT					= 10100;
	public static final int								OBJ_TYPE_COMMEND					= 10101;
	public static final int								OBJ_TYPE_SKU						= 10120;
	public static final int								OBJ_TYPE_MOVEMENT_ARTICLE_TYPE		= 10110;
	public static final int								OBJ_TYPE_FEE_DOCUMENT				= 10130;

	public static final long							ACTIVITY99_PRICE					= 3300L;

	public static final int								PRODUCT_SORT_STYLE					= 31005;

	public static final String							SINGLE_SHOPPINGCART					= "SINGLE_SHOPPINGCART";

	// "类目分类"所属Column ID
	public static final int								PRODUCT_CLASS_MNG					= 603;

	public static boolean								ENABLE_MEMCACHED					= true;
	public static String								MEMCACHED_ADDRESS					= "127.0.0.1:12321";

	public static final int								LOGIN_TYPE_PARTNER					= 1;
	public static final int								COLUMN_ROOT_ID						= 1;
	public static final int								COLUMN_MERCHANTCOLUMN_ID			= 7;

	public static final String							ATTR_INNERNAME_ORGID				= "organizationCode";

	public static final int								MERCHANT_ROOT_COLUMNID				= 7;
	public static final int								MERCHANT_ADMIN_ROLEID				= 2;

	public static final int								INFO_COLUMNID						= 4;
	public static final int								PRODUCT_CATEGORY_ROOT_COLUMNID		= 601;
	public static final String							EH_CACHE_KEY_ARTICLE				= "article";
	public static final String							KEY_FRONTEND_MERCHANTID				= "frontMid";

	public static final int								APP_FRIST_ORDER_TYPE				= 11;										//app首次下单
	public static final String							DATEFORMATPATTERN					= "yyyy-MM-dd HH:mm:ss";
	public static final int								SHOPPING_TYPE						= 1;										//消费购物
	public static final int								REMARK_TYPE							= 2;										//评价
	public static final int								RECOMMEND_FRIEND_TYPE				= 3;										//推荐好友
	public static final int								ATTORNEY_TYPE						= 4;										//代理商品
	public static final int								SHARE_TYPE							= 5;										//分享
	public static final int								RECOMMNED_SHOPPING_TYPE				= 6;										//被推荐人消费购物类型
	public static final int								RECHARGE_PHONE_TYPE					= 7;										//话费充值类型
	public static final int								RECOMMEND_RECHARGE_PHONE_TYPE		= 8;										//被推荐人充值话费
	public static final int								FILLIN_RECOMMEND_TYPE				= 9;										//填写推荐人
	public static final int								UP_GRADE_TYPE						= 10;										//会员升级活动
	public static final int								ADMIN_ADD_TYPE						= 100;										//系统补发名望值
	public static final int								ADMIN_REDUCE_TYPE					= 101;										//系统扣除名望值

	public static final int								MERCHANTS_PRE_TYPE					= 3;										//开店特权
	public static final int								ATTORNEY_PRE_TYPE					= 2;										//产品代理特权
	public static final int								RECOMMEND_PRE_TYPE					= 1;										//推荐好友特权

	public static final int								SHARE_MYLEVEL_TYPE					= 1;										//分享我的等级类型
	public static final int								SHARE_MYSHOP_TYPE					= 2;										//分享我的店铺类型
	public static final int								SHARE_RECOMMEND_TYPE				= 3;										//分享推荐有礼类型
	public static final int								SHARE_ARTICLE_TYPE					= 4;										//分享商品类型
	public static final int								SHARE_ORTHER_TYPE					= 5;										//分享其他类型

	public static final String[]						ACTIVE_CODE							= {
			"6211", "1212", "sanhao", "taiheyibu", "taiheerbu", "zhengdao", "luomai365", "jihuo",
			"qicheng", "zhihuitixi", "jinyaoshi360", "zhengtai", "chaoyue", "tiantuo", "JNTX",
			"mingliang365", "365ysgj", "taiheyunlong", "taihetiancheng", "chaoyue365"		};

	public static final String							MERCHANT_NAME						= "品质365";
	public static final String							ONLINE								= "/online";
	public static final String							TEST								= "/local";
	public static final int								ATTORNEY_PRODUCT					= 3261;									//推荐代理商品column
	public static final String							CANCEL_GUIDE_PRODUCT				= "1403";
	public static final String							DOMAIN								= "www.pinzhi365.com";
	public static final String							SERVER_ADDR							= "http://"
																									+ DOMAIN;
	public static final String							SERVER_TEST_ADDR					= "http://119.57.171.254";

	public static final String							CLUSTERKEY_SHOPPINGCART				= "CLUSTERKEY_SHOPPINGCART";

	public static final int								REGION_TOP							= 1602;

	// 用于确认订单的防止重复提交 令牌
	public static final String							ORDER_FORM_TOKEN					= "orderFormToken";

	public static final int								PRESENT_ARTICLE_TYPE				= 1;										//单品赠品类型
	public static final int								PRESENT_ORDER_TYPE					= 2;										//加价赠品类型
	public static final int								PRESENT_SIMPLEORDER_TYPE			= 3;										//订单赠品类型

	public static final boolean							MEMCACHE_DEFAULT					= true;

	public static final SimpleDateFormat				_DATE_FORMAT						= new SimpleDateFormat(
																									"yyyy-MM-dd HH:mm:ss");

	public static final double							DE_TOTAL_AMOUNT						= 1100.0D;									// DOUBLE_ELEVEN_TOTAL_AMOUNT_LIMIT
	public static final double							DE_HISTORY_ORDERS_TOTALA_MOUNT		= 11000.0D;								//DOUBLE_ELEVEN_HISTORY_ORDERS_TOTAL_AMOUNT_LIMIT

	public static final int								ROOTPARTNERID						= 139600;									//自助商品供应商编号

	public static final ConcurrentHashMap<String, Date>	ipVisit								= new ConcurrentHashMap<String, Date>();

	public static final Map<String, Object>				GLOBALCONFIG						= new HashMap<String, Object>();
	//尾页导航
	public static final int								PAGE_END_NAVIGATION					= 3220;
	public static final int								FRONT_SHOW_YES						= 1;
	public static final int								FRONT_SHOW_NO						= 0;
	public static final int								SEARCHRESULT_RIGHT					= 655005;									//机票搜索结果页右侧广告位

}
